<template>
  <div>
    <div class="banner" @click="handleShowGallary">
      <img class="banner-img" :src="bannerImg" alt="">
      <div class="banner-info">
        <h3>郑州园博园</h3>
        <div class="banner-info-right">
          <span class="iconfont">&#xe692;</span>
          88
        </div>
      </div>
    </div>
    <transition-fade>
      <gallary
        :gallarryUrlList="gallaryImgs"
        v-show="showGall"
        @showGallary="handleShowGallary"
      ></gallary>
    </transition-fade>
  </div>
</template>

<script>
import Gallary from 'common/gallary/Gallary'
import TransitionFade from 'common/fade/Fade'
export default {
  name: 'Banner',
  props: {
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      showGall: false
    }
  },
  components: {
    Gallary,
    TransitionFade
  },
  methods: {
    handleShowGallary () {
      this.showGall = !this.showGall
    }
  }
}
</script>

<style lang="stylus" scoped>
  .banner
    position: relative
    overflow: hidden
    height: 0
    padding-bottom: 55%
    .banner-img
      width: 100%
    .banner-info
      height: .6rem
      display: flex
      position: absolute
      left: 0
      right: 0
      bottom: 0
      color: #fff
      background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))
      h3
        flex: 1
        line-height: .6rem
        padding: 0 .2rem
        font-size: .31rem
      .banner-info-right
        height: .4rem
        line-height: .4rem
        margin-top: .1rem
        padding: 0 .4rem
        background: rgba(0, 0, 0, 0.8)
        border-radius: .2rem
        margin-right: .1rem
        font-size: .24rem
        span
          font-size: .24rem
</style>
